<?php /* Smarty version 2.6.20, created on 2013-05-25 01:50:40
         compiled from _core/_include/manage/workermakeup.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'escape', '_core/_include/manage/workermakeup.tpl', 7, false),)), $this); ?>
function WorkerMakeup() {
};

WorkerMakeup.instance = function(callbackFunc) {
  var popupBox = new PopupBox(), _self = this;
  
  var model = Model.instance('<?php echo ((is_array($_tmp=@MODEL_NAME_USER_MAKEUP)) ? $this->_run_mod_handler('escape', true, $_tmp, 'javascript') : smarty_modifier_escape($_tmp, 'javascript')); ?>
', '<?php echo ((is_array($_tmp=@MODEL_TITLE_USER_MAKEUP)) ? $this->_run_mod_handler('escape', true, $_tmp, 'javascript') : smarty_modifier_escape($_tmp, 'javascript')); ?>
', '<?php echo ((is_array($_tmp=@MODEL_TYPE_PRODUCT)) ? $this->_run_mod_handler('escape', true, $_tmp, 'javascript') : smarty_modifier_escape($_tmp, 'javascript')); ?>
');
  
  //Create model here...
  var state1 = State.instance(model, 0, 'not activate (No Wedding Day)');
  var state2 = State.instance(model, 1, 'arrange makeup artist');
  var state3 = State.instance(model, 2, 'confirm makeup artist');
  var state4 = State.instance(model, 3, 'remind makeup artist');
  var state5 = State.instance(model, 4, 'job completed by makeup artist');
  var transition1 = Transition.instance('arrange', state2, state3, '<?php echo ((is_array($_tmp=@USER_TYPE_MANAGER_ASSISTANT)) ? $this->_run_mod_handler('escape', true, $_tmp, 'javascript') : smarty_modifier_escape($_tmp, 'javascript')); ?>
', DlmanageUtils.dop, -60);
  var transition2 = Transition.instance('confirmed', state3, state4, '<?php echo ((is_array($_tmp=@USER_TYPE_MANAGER_ASSISTANT)) ? $this->_run_mod_handler('escape', true, $_tmp, 'javascript') : smarty_modifier_escape($_tmp, 'javascript')); ?>
', DlmanageUtils.dop, -30);
  var transition3 = Transition.instance('reminded', state4, state5, '<?php echo ((is_array($_tmp=@USER_TYPE_MANAGER_ASSISTANT)) ? $this->_run_mod_handler('escape', true, $_tmp, 'javascript') : smarty_modifier_escape($_tmp, 'javascript')); ?>
', DlmanageUtils.none,3);
  
  var transition4 = Transition.instance('arrange', state2, state3, '<?php echo ((is_array($_tmp=@USER_TYPE_MANAGER)) ? $this->_run_mod_handler('escape', true, $_tmp, 'javascript') : smarty_modifier_escape($_tmp, 'javascript')); ?>
', DlmanageUtils.dop, -60);
  var transition5 = Transition.instance('confirmed', state3, state4, '<?php echo ((is_array($_tmp=@USER_TYPE_MANAGER)) ? $this->_run_mod_handler('escape', true, $_tmp, 'javascript') : smarty_modifier_escape($_tmp, 'javascript')); ?>
', DlmanageUtils.dop, -30);
  var transition6 = Transition.instance('reminded', state4, state5, '<?php echo ((is_array($_tmp=@USER_TYPE_MANAGER)) ? $this->_run_mod_handler('escape', true, $_tmp, 'javascript') : smarty_modifier_escape($_tmp, 'javascript')); ?>
', DlmanageUtils.none,3);
  
  var transition7 = Transition.instance('arrange', state2, state3, '<?php echo ((is_array($_tmp=@USER_TYPE_ADMIN)) ? $this->_run_mod_handler('escape', true, $_tmp, 'javascript') : smarty_modifier_escape($_tmp, 'javascript')); ?>
', DlmanageUtils.dop, -60);
  var transition8 = Transition.instance('confirmed', state3, state4, '<?php echo ((is_array($_tmp=@USER_TYPE_ADMIN)) ? $this->_run_mod_handler('escape', true, $_tmp, 'javascript') : smarty_modifier_escape($_tmp, 'javascript')); ?>
', DlmanageUtils.dop, -30);
  var transition9 = Transition.instance('reminded', state4, state5, '<?php echo ((is_array($_tmp=@USER_TYPE_ADMIN)) ? $this->_run_mod_handler('escape', true, $_tmp, 'javascript') : smarty_modifier_escape($_tmp, 'javascript')); ?>
', DlmanageUtils.none,3);
  
  transition1.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                      options = {};
                                                                                    }
                                                                                    var previous = MiscUtils.clone(produce);
                                                                                    options.previous = previous;
                                                                                    var div = document.createElement('div');
                                                                                    var func1 = function() { if (!options) {
                                                                                                               options = {};
                                                                                                             }
                                                                                                             if (produce.user_account == '') {
                                                                                                               window.alert('选择一个工作人员');
                                                                                                               return;
                                                                                                             }
                                                                                                             options.extra = produce.user_account;
                                                                                                             var func3 = function(){
                                                                                                                DlmanageUtils.operate(transition1, pos, callbackFunc, produce, user, date, options);
                                                                                                             }
                                                                                                             
                                                                                                              DlmanageUtils.sendEmail(produce,pos,func3,callbackFunc,user);
                                                                                                             popupBox._close();
                                                                                                           };
                                                                                    var func2 = function() { popupBox._close();
                                                                                                             callbackFunc();
                                                                                                           };
                                                                                    MiscUtils.dialog(popupBox, pos, div, func1, func2);
                                                                                    new DialogAssignee(div, produce, { php: 'customphp/mysqlread.php', condition: 'd.mEnabled = 1 and d.isdisplay = 0', orderTrackId: produce.orderTrackId });
                                                                                  };
 
   transition2.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                    options = {};
                                                                                  }
                                                                                  var previous = MiscUtils.clone(produce);
                                                                                  options.previous = previous;
                                                                                  options.func = function(div, pos, options) { MiscUtils.dialog(popupBox, pos, div); };
                                                                                  
                                                                                  
                                                                                                           options.extra = produce.user_account;
                                                                                                           
                                                                                                               var func3 = function(){
                                                                                                                DlmanageUtils.operate(transition2, pos, callbackFunc, produce, user, date, options);
                                                                                                             }
                                                                                                             
                                                                                                              DlmanageUtils.sendEmail(produce,pos,func3,callbackFunc,user);
                                                                                
                                                                                }; 
  
  transition3.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                      options = {};
                                                                                    }
                                                                                    var previous = MiscUtils.clone(produce);
                                                                                    options.previous = previous;
                                                                                    options.stage = 2;
                                                                                    options.func = function(div, customer, options) { new DialogLocation(div, customer, options); };
                                                                                    
                                                                                    var func3 = function(){
                                                                                      DlmanageUtils.operate3(transition3, pos, callbackFunc, produce, user, date, options);
                                                                                    }
                                                                                    DlmanageUtils.sendEmail(produce,pos,func3,callbackFunc,user);
                                                                                  };
                                                                                  
  transition4.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                      options = {};
                                                                                    }
                                                                                    var previous = MiscUtils.clone(produce);
                                                                                    options.previous = previous;
                                                                                    var div = document.createElement('div');
                                                                                    var func1 = function() { if (!options) {
                                                                                                               options = {};
                                                                                                             }
                                                                                                             if (produce.user_account == '') {
                                                                                                               window.alert('选择一个工作人员');
                                                                                                               return;
                                                                                                             }
                                                                                                             options.extra = produce.user_account;
                                                                                                             var func3 = function(){
                                                                                                                DlmanageUtils.operate(transition4, pos, callbackFunc, produce, user, date, options);
                                                                                                             }
                                                                                                             
                                                                                                              DlmanageUtils.sendEmail(produce,pos,func3,callbackFunc,user);
                                                                                                             popupBox._close();
                                                                                                           };
                                                                                    var func2 = function() { popupBox._close();
                                                                                                             callbackFunc();
                                                                                                           };
                                                                                    MiscUtils.dialog(popupBox, pos, div, func1, func2);
                                                                                    new DialogAssignee(div, produce, { php: 'customphp/mysqlread.php', condition: 'd.mEnabled = 1 and d.isdisplay = 0', orderTrackId: produce.orderTrackId });
                                                                                  };

  transition5.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                    options = {};
                                                                                  }
                                                                                  var previous = MiscUtils.clone(produce);
                                                                                  options.previous = previous;
                                                                                  options.func = function(div, pos, options) { MiscUtils.dialog(popupBox, pos, div); };
                                                                                  
                                                                                  
                                                                                                           options.extra = produce.user_account;
                                                                                                           
                                                                                                               var func3 = function(){
                                                                                                                DlmanageUtils.operate(transition5, pos, callbackFunc, produce, user, date, options);
                                                                                                             }
                                                                                                             
                                                                                                              DlmanageUtils.sendEmail(produce,pos,func3,callbackFunc,user);
                                                                                
                                                                                }; 

  transition6.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                      options = {};
                                                                                    }
                                                                                    var previous = MiscUtils.clone(produce);
                                                                                    options.previous = previous;
                                                                                    options.stage = 2;
                                                                                    options.func = function(div, customer, options) { new DialogLocation(div, customer, options); };
                                                                                      
                                                                                    var func3 = function(){  
                                                                                      DlmanageUtils.operate3(transition6, pos, callbackFunc, produce, user, date, options);
                                                                                    }
                                                                                      DlmanageUtils.sendEmail(produce,pos,func3,callbackFunc,user);
                                                                                  };
transition7.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                    options = {};
                                                                                  }
                                                                                  var previous = MiscUtils.clone(produce);
                                                                                  options.previous = previous;
                                                                                  var div = document.createElement('div');
                                                                                  var func1 = function() { if (!options) {
                                                                                                             options = {};
                                                                                                           }
                                                                                                           if (produce.user_account == '') {
                                                                                                             window.alert('选择一个工作人员');
                                                                                                             return;
                                                                                                           }
                                                                                                           options.extra = produce.user_account;
                                                                                                             var func3 = function(){
                                                                                                                DlmanageUtils.operate(transition7, pos, callbackFunc, produce, user, date, options);
                                                                                                             }
                                                                                                             
                                                                                                              DlmanageUtils.sendEmail(produce,pos,func3,callbackFunc,user);
                                                                                                           popupBox._close();
                                                                                                         };
                                                                                  var func2 = function() { popupBox._close();
                                                                                                           callbackFunc();
                                                                                                         };
                                                                                  MiscUtils.dialog(popupBox, pos, div, func1, func2);
                                                                                  new DialogAssignee(div, produce, { php: 'customphp/mysqlread.php', condition: 'd.mEnabled = 1 and d.isdisplay = 0', orderTrackId: produce.orderTrackId });
                                                                                };

  transition8.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                    options = {};
                                                                                  }
                                                                                  var previous = MiscUtils.clone(produce);
                                                                                  options.previous = previous;
                                                                                  options.func = function(div, pos, options) { MiscUtils.dialog(popupBox, pos, div); };
                                                                                  
                                                                                  
                                                                                                           options.extra = produce.user_account;
                                                                                                           
                                                                                                               var func3 = function(){
                                                                                                                DlmanageUtils.operate(transition8, pos, callbackFunc, produce, user, date, options);
                                                                                                             }
                                                                                                             
                                                                                                              DlmanageUtils.sendEmail(produce,pos,func3,callbackFunc,user);
                                                                                
                                                                                }; 

transition9.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                    options = {};
                                                                                  }
                                                                                  var previous = MiscUtils.clone(produce);
                                                                                  options.previous = previous;
                                                                                  options.stage = 2;
                                                                                  options.func = function(div, customer, options) { new DialogLocation(div, customer, options); };
                                                                                  
                                                                                  var func3 = function(){
                                                                                    DlmanageUtils.operate3(transition9, pos, callbackFunc, produce, user, date, options);
                                                                                  }
                                                                                    DlmanageUtils.sendEmail(produce,pos,func3,callbackFunc,user);
                                                                                };
  model.states = [ state1, state2, state3, state4, state5 ];
  model.transitions = [ transition1, transition2, transition3, transition4, transition5, transition6, transition7, transition8, transition9 ];
  return model;
};